/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

import Entity.Director;
import Entity.Movie;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;

/**
 *
 * @author Leoz
 */
public class directorDao {
    public Director searchbyName(String name, EntityManager em) throws NoResultException{
        Query q = em.createNamedQuery("Director.findByName").setParameter("name", name);
        Director director = (Director) q.getSingleResult();
        return director;
    }
    
}
